package com.yc.myspringboot.ioc.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.context.support.RequestHandledEvent;
import org.springframework.web.context.support.ServletRequestHandledEvent;

/**
 * 监听springmvc的请求DispatcherServlet
 * @author yuancan
 *
 */
@Component
public class RequestNotify implements ApplicationListener<ServletRequestHandledEvent> {//实际发布的是什么类型的event

	@Override
	public void onApplicationEvent(ServletRequestHandledEvent event) {
		System.out.println("---RequestNotify----ServletRequestHandledEvent---" + event.getDescription());
	}

//	@Override
//	public void onApplicationEvent(RequestHandledEvent event) {
//		System.out.println("---RequestNotify-------" + event.getDescription());
//		
//	}

}
